<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>七宫格布局--flex--一维</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }
        .row {
            width: 100%;
            display: flex;
        }
        .item {
            height: 100px;
            width: 30%;
            background-color: pink;
            border: 1px solid black;
            text-align: center;
            line-height: 100px;
        }
        .first_row :nth-child(2),
        .third_row :nth-child(2){
            margin-left: auto;
        }
        .second_row .item {
            margin: auto;
        }
        .forth_row {
            margin: auto;
        }

    </style>
</head>
<body>
    <div class="container">
        <div class="row first_row">
            <div class="item">1</div>
            <div class="item">2</div>
        </div>
        <div class="row second_row"> 
            <div class="item">3</div>
        </div>
        <div class="row third_row">
            <div class="item">4</div>
            <div class="item">5</div>
        </div>
        <div class="row forth_row">
            <div class="item">6</div>
            <div class="item">7</div>
        </div>
    </div>
</body>
</html>